<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%--
  Created by IntelliJ IDEA.
  User: 编程大师凡哥
  Date: 2022-11-23
  Time: 14:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <base href="${pageContext.request.contextPath}/">
    <title>新闻管理</title>
</head>
<body>
<h1>高老板</h1>
<p><a href="news/insert">新增</a></p>
<form method="get">
    <p>标题<input name="title" value="${param.title}"/></p>
    <button type="submit" id="select">查询</button>
</form>

<c:forEach items="${pageInfo.list}" var="item">
    <p>
            ${item.title},${item.content},
            ${item.createTime}
    </p>
    <p><a href="news/delete?id=${item.id}">删除</a>
        <a href="news/update?id=${item.id}">修改</a>
    </p>
</c:forEach>
<!--分页盒子-->
<div id="pagediv">
<c:if test="${pageInfo.hasPreviousPage}">
    <a href="news?title=${param.title}&pageIndex=${pageInfo.prePage}">上一页</a>
</c:if>
<c:forEach begin="1" end="${pageInfo.pages}" var="item">
    <a href="news?title=${param.title}&pageIndex=${item}">${item}</a>
</c:forEach>
<c:if test="${pageInfo.hasNextPage}">
    <a href="news?title=${param.title}&pageIndex=${pageInfo.nextPage}">下一页</a>
</c:if>
    <span>共${pageInfo.pages}页</span>
</div>
</body>

</html>
